var myChart = echarts.init(document.getElementById("idx1"))
var option = {
    xAxis: {
    },
    yAxis: {
    },
    title: {
        text: '简单气泡图--周子昂',
        left: 'center',
    },
    series:{
        label: {
            position: 'top',
            show: true,
            formatter: '({b}{c})',
        },
        type:'scatter',
        data:[[1,1,20],[2,3,39],[5,2,13],[7,6,27]],
        symbolSize: function(x){
            return x[2]
        },
    },
};
myChart.setOption(option);
//----------------------------------------------
var myChart2 = echarts.init(document.getElementById("idx2"))
var option2 = {
    xAxis: {
    },
    yAxis: {
    },
    title: {
        text: '简单气泡图--周子昂',
        left: 'center',
    },
    series:{
        type:'effectScatter',
        data:[[1,1,20],[2,3,39],[5,2,13],[7,6,27]],
        symbolSize: function(x){
            return x[2]
        },
    },
};
myChart2.setOption(option2);
//----------------------------------------------
function getRandInt(a,b){
    return Math.floor(a + (b-a)*Math.random());a;
}
var myChart3 = echarts.init(document.getElementById("idx3"))
var x,y,z;
var ndata = [];
for(var i=0;i<50;i++){
    x = getRandInt(1,100);
    y = getRandInt(1,100);
    z = getRandInt(2,25);
    ndata.push([x,y,z])
}
var option3 = {
    xAxis: {
    },
    yAxis: {
    },
    title: {
        text: '简单气泡图--周子昂',
        left: 'center',
    },
    series:{
        type:'scatter',
        data:ndata,
        symbolSize: function(x){
            return x[2]
        },
    },
};
myChart3.setOption(option3);
//----------------------------------------------
function getRandInt(a,b){
    return Math.floor(a + (b-a)*Math.random())
}
var myChart4 = echarts.init(document.getElementById("idx4"))
var x,y,z;
var ndata = [];
for(var i=0;i<50;i++){
    x = getRandInt(1,100);
    y = getRandInt(1,100);
    z = getRandInt(2,25);
    ndata.push([x,y,z])
}
var option4 = {
    xAxis: {
    },
    yAxis: {
    },
    title: {
        text: '简单气泡图--周子昂',
        left: 'center',
    },
    series:{
        type:'scatter',
        data:ndata,
        symbolSize: function(x){
            return x[2]
        },
    },
};
myChart4.setOption(option4);
setInterval(function(){
    var x,y,z;
    var ndata = [];
    for(var i=0;i<50;i++){
        x = getRandInt(1,100);
        y = getRandInt(1,100);
        z = getRandInt(2,25);
        ndata.push([x,y,z])
};
    option4.series.data = ndata;
    myChart4.setOption(option4);
},1000)
//----------------------------------------------
